<?php echo $header; ?>
<div class="page">
	<div class="personal_info">
    	Welcome,<span id="userName"><?php echo $this->customer->getLastName() ?></span>
					<a href="index.php?route=account/logout">logout</a>
    </div>
	<div class="greenPanel">
		<table width="95%" cellpadding="0" cellspacing="0" align="center" style="margin:auto;">
			<tr>
				<td colspan="3" align="left" height="50px">
					<a href="javascript:void(0)" style="float:left;background:url(catalog/view/theme/default/images/agreeItem.png);padding:8px 70px 17px 62px;">Account</a>
				</td>
			</tr>
			<tr>
				<?php echo $left; ?>
				<td style="height:500px;" valign="top" class="ManageMain">
					<ul>
						<li>Address Book</li>
					</ul>

					<table border="0" cellpadding="0" cellspacing="0" width="100%" class="list2" style="display: table">
						<?php if ($success) { ?>
						<tr><td>
						<div class="success"><?php echo $success; ?></div></td></tr>
						<?php } ?>
						<?php if ($error_warning) { ?>
						<tr><td>
						<div class="warning"><?php echo $error_warning; ?></div></td></tr>
						<?php } ?>
						<?php foreach ($addresses as $result) { ?>
							<tr width="100%"><td>
								<table cellpadding="0" cellspacing="0" width="100%">
									<tr>
										<td width="90%" class="textleft"><?php echo $result['address']; ?>;</td>
										<td rowspan="5" bgcolor="#EAEAEA">
											<a href="javascript:void(0)" onclick="show('<?php echo $result['update']; ?>')">Edit</a><br>
											<a href="<?php echo $result['delete']; ?>">Delete</a>
										</td>
									</tr>
								</table>
							</td></tr>
							<tr><td>&nbsp;</td></tr>
						<?php }?>
						<tr height="35"><td class="textright"><input name="" type="button" value="Add Address" class="submit_button" onclick="show('<?php echo $insert; ?>')"></td></tr>
						<tr>
							<td class="textleft" id="address_frame">
								
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript" language="javascript"> 
function iFrameHeight() { 
var ifm= document.getElementById("address_frame"); 
var subWeb = document.frames ? document.frames["address_frame"].document : ifm.contentDocument; 
if(ifm != null && subWeb != null) { 
ifm.height = subWeb.body.scrollHeight; 
} 
} 
function show(urls){
	$.ajax({
		url:urls,
		success:function(data){
			$('#address_frame').html(data);
		}
	})
}
</script> 
<?php echo $footer; ?>